set more off

use "dataset_newslibrary", clear

local w1start = week(date("05-07-2015", "MDY"))
local w1end = week(date("06-02-2015", "MDY"))
local w2start = week(date("08-07-2015", "MDY"))
local w2end = week(date("08-12-2015", "MDY"))
local w3start = week(date("09-11-2015", "MDY"))
local w3end = week(date("09-20-2015", "MDY"))

forvalues i = 1(1)12 {
	if `i' < 10 local i = "0" + "`i'"
	local myweek = week(date("`i'-01-2015", "MDY"))
	local weeks `weeks' `myweek'
}
di "`weeks'"

#delimit;

gr tw 
	(line hit week if year, col(black) lwid(medthick))
	(scatteri 19.4 21 "Wave 1", msymbol(i) mlabpos(0) mlabangle(90))
	(scatteri 17.1 31 "Gen Election / Wave 2", msymbol(i) mlabpos(0) mlabangle(90))	
	(scatteri 18.2 36 "Runoff Election", msymbol(i) mlabpos(0) mlabangle(90))		
	,
		plotregion(style(none))
		legend(off)
		xlab(
			1 "Jan"
			5 "Feb"
			9 "Mar"
			13 "Apr"
			18 "May"
			22 "Jun"
			26 "Jul"
			31 "Aug"
			35 "Sep"
			40 "Oct"
			44 "Nov"
			48 "Dec"
		)
		ylab(0(5)20, angle(horiz))
		ytitle("Number of articles")
		xtitle("Week")
		xline(`w1end')
		xline(`w2end')
		xline(`w3start')
		;
		
#delimit cr

gr export "figure A5.eps", replace
shell epstopdf "figure A5.eps"
